package com.h.aop.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;


@Slf4j
@Aspect
@Component
public class MyAspectDemo {
   @Around("@annotation(com.h.aop.aspect.MyAspect)")
   public Object doAround(ProceedingJoinPoint pjp) {
      log.info("MyAspect Around环绕通知开始.....");

      Object proceed = null;
      try {
         proceed = pjp.proceed();
      } catch (Throwable e) {
         throw new RuntimeException(e);
      }

      log.info("MyAspect Around环绕通知结束.....");

      return proceed;
   }
}
